const API = require('../../pages/api/index')
const { typeJson } = require('../../utils/typejson')
let prolist = wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist'))


Page({

  /**
   * 页面的初始数据
   */
  data: {
    pulldown:"",
    pullup:2,
    addButton:true,
    prolist:wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist')),
    listConfig: [
        {
          label: '计划名称',
          prop: 'planName'
        },
        {
          label: '创建人',
          prop: 'createMan'
        }
      ],

      slide: {
        slideButton: {
          text: '编辑',
          extClass: 'test',
            src: '/page/weui/cell/icon_star.svg', // icon的路径
        },
        formConfig: [
          {
            label: '计划名称',
            prop: 'planName',
            required:true,
          },
          {
            label: '设备名称',
            prop: 'deviceName',
            required:true,
          },
          {
            label: '所处位置',
            prop: 'location',
            required:true,
          },
          {
            label: '检查详情',
            prop: 'checkInfo',
          },
          {
            label: '创建日期',
            prop: 'checkDate',
            type:'date',
            hidden:"edit",
          },
  
          ],
      },

 
      formConfig: [
        {
          label: '计划名称',
          prop: 'planName',
          required:true,
        },
        {
          label: '设备名称',
          prop: 'deviceName',
          required:true,
        },
        {
          label: '所处位置',
          prop: 'location',
          required:true,
        },
        {
          label: '检查详情',
          prop: 'checkInfo',
        },
        {
          label: '创建日期',
          prop: 'checkDate',
          type:'date',
          hidden:"edit",
        },

        ],
    
        
        net: {
       
            select: {
              url: `/app/deviceCheckPlan/getList`,
              method: 'post',
              data: {
                mineId: true,
                planType:3
              }
            },
            delete: {
              url: '/app/deviceCheckPlan/delete',
              method: 'get',
              data: {
                
              }
            },
            insert: {
              url: '/app/deviceCheckPlan/insert',
              method: 'post',
              data: {
                mineId:true,
                createManId:"userid",
                planType:3
              }
            },
            update: {
              url: '/app/deviceCheckPlan/update',
              method: 'post',
              data: {
  
              }
            }
  
          
        },
        showCom: true
      },

     
  

  /**
   * 生命周期函数--监听页面加载
   */


  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
  
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    console.log('5555');
    this.setData({
      showCom: false
    });
    this.setData({
      showCom: true
    });
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    wx.stopPullDownRefresh()
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    this.setData({
      pullup: this.data.pullup + 1
    })
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})